//
//  ZFSegmentControl.h
//  PageHolder
//
//  Created by 赵梁 on 2017/1/3.
//  Copyright © 2017年 赵梁. All rights reserved.
//

#import <UIKit/UIKit.h>

@class ZFSegmentControl;

@protocol ZFSegmentControlDelegate <NSObject>

- (void)zf_segmentControl:(nullable ZFSegmentControl *)control didSelectedIndex:(NSInteger)index;

@end

@protocol ZFSegmentControlDataSource <NSObject>

- (NSInteger)numberOfItemsInZFSegmentControl:(nullable ZFSegmentControl *)control;

- (nullable UIView*)zf_segmentControl:(nullable ZFSegmentControl *)control viewForItemAtIndex:(NSInteger)index reusingView:(nullable UIView *)view didSelected:(BOOL)didSelected;

@end

@interface ZFSegmentControl : UIView

@property (nonatomic, weak, nullable) IBOutlet id<ZFSegmentControlDelegate> delegate;//!<
@property (nonatomic, weak, nullable) IBOutlet id<ZFSegmentControlDataSource> dataSource;//!<


- (void)selectIndex:(NSInteger)index;
- (void)moveIndexWithProgress:(float)progress;
- (void)endMoveIndex:(NSInteger)index;

#pragma mark -line
@property (nonatomic, strong, nonnull) UIColor *lineColor;//!< 线条颜色
@property (nonatomic, assign) CGFloat lineHeight;//!< 线条高度 default 3.

@end
